package learn.particleSys;

import processing.core.PApplet;
import processing.core.PVector;

public class SingleParticle extends PApplet {
	public static void main(String[] args) {
		PApplet.main(new String[] { "--present", "SingleParticle" });
	}

	Particle particle;

	public void setup() {
		size(800, 600);
		particle = new Particle(this, new PVector(width / 2, height / 2));

		background(255);
		smooth();
	}

	public void draw() {
		background(255);

		particle.run();
		if (particle.isDead()) {
			particle = new Particle(this, new PVector(random(width),
					random(height)));
			print("Particle dead!");
		}
	}
}
